package zwp.example.demo1.demo_controller;

import com.alibaba.fastjson.JSONObject;
import zwp.example.demo1.demo_pojo.domain.DishDomain;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import zwp.example.demo1.demo_mapper.DishMapper;

/**
 * @Author zwp14
 * @create 2024/6/10 12:43
 * @description 连接数据库测试
 */
@RequiredArgsConstructor
@RestController
@RequestMapping("/mySqlTest")
public class DemoMySqlDataTest {
    private final DishMapper dishMapper;


    @GetMapping("test1")
    public String test1() {
        DishDomain dishDomain = dishMapper.queryDish();
        String s = JSONObject.toJSONString(dishDomain);
        System.out.println(s);
        return s;
    }

}
